import { request } from 'thinkive-hvue'

export function queryList(params, options) {
  return new Promise((resolve, reject) => {
    let _params = {
      funcNo: '2001100',
      curPage: 1,
      numPerPage: 8,
    }
    request({ _params, params, options }).then(
      res => {
        resolve(res)
      },
      err => {
        reject(err)
      },
    )
  })
}
///查询观点列表
export function queryViewpointList(params, options) {
  return new Promise((resolve, reject) => {
    let _params = {
      funcNo: '2001104',
      curPage: 1,
      numPerPage: 8,
    }
    request({ _params, params, options }).then(
      res => {
        resolve(res)
      },
      err => {
        reject(err)
      },
    )
  })
}
// 查询观点详情
export function queryViewpointDetail(params, options) {
  return new Promise((resolve, reject) => {
    let _params = {
      funcNo: '2001111',
    }
    request({ _params, params, options }).then(
      res => {
        resolve(res)
      },
      err => {
        reject(err)
      },
    )
  })
}

// 关注操作
export function addFoucsFun(params, options) {
  return new Promise((resolve, reject) => {
    let _params = {
      funcNo: '2001204',
    }
    let _options = { loading: false }
    request({ _params, params, options, _options }).then(
      res => {
        resolve(res)
      },
      err => {
        reject(err)
      },
    )
  })
}
// 点赞操作
export function addLikeFun(params, options) {
  return new Promise((resolve, reject) => {
    let _params = {
      funcNo: '2001220',
      type: '0',
    }
    let _options = { loading: false }
    request({ _params, params, options, _options }).then(
      res => {
        resolve(res)
      },
      err => {
        reject(err)
      },
    )
  })
}
